﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
/// <summary>
/// BookIBll 的摘要说明
/// </summary>
public class BookManageBll : DataBase
{
    public BookManageBll()
    {

    }
    /// <summary>
    /// 添加--图书信息
    /// </summary>
    /// <param name="bookmanage"></param>
    /// <returns></returns>
    public int AddBook(BookManageEntiry bookmanage)
    {
        SqlParameter[] prams = {
            MakeInParam("@bookcode",  SqlDbType.VarChar, 30, bookmanage.BookCode),
            MakeInParam("@bookname",  SqlDbType.VarChar, 50,bookmanage.BookName ),
            MakeInParam("@type",  SqlDbType.VarChar, 50, bookmanage.Type ),
            MakeInParam("@author",  SqlDbType.VarChar, 50, bookmanage.Author ),
            MakeInParam("@translator",  SqlDbType.VarChar, 50, bookmanage.Translator ),
            MakeInParam("@pubname",  SqlDbType.VarChar, 100, bookmanage.PubName ),
            MakeInParam("@price",  SqlDbType.Money, 8, bookmanage.Price ),
            MakeInParam("@page",  SqlDbType.Int, 4,bookmanage.Page ),
            MakeInParam("@bcase",  SqlDbType.VarChar, 50, bookmanage.Bcase ),
            MakeInParam("@storage",  SqlDbType.BigInt, 8, bookmanage.Storage ),
            MakeInParam("@inTime",  SqlDbType.DateTime, 8, bookmanage.InTime ),
            MakeInParam("@oper",  SqlDbType.VarChar, 30, bookmanage.Oper ),
            };
        return (RunProc("INSERT INTO tb_bookinfo (bookcode,bookname,type,author,translator,pubname,price,page,bcase,storage,inTime,oper) "
            + "VALUES (@bookcode,@bookname,@type,@author,@translator,@pubname,@price,@page,@bcase,@storage,@inTime,@oper)", prams));
    }
    ///可添加其他功能
}